package day62;

public class ThreadDemo {

	public static void main1(String[] args) {
		// 程序运行的时候，默认运行的就是主线程
		
		MyThread myThread = new MyThread();
		// 这不是启动一个线程，这个调用对象里面一个普通方法run()方法
		// myThread.run();
		// 真正启动一个线程调用start()方法，但是执行的代码就是run()方法里面的代码
		myThread.start();
		
		for (int i = 0; i < 100; i++) {
			System.out.println("main:" + i);
		}
	}
	
	public static void main2(String[] args) {
		MyRunnable myRunnable = new MyRunnable();
		Thread thread = new Thread(myRunnable);
		thread.start();
	}
	
	public static void main(String[] args) {
		JiShuThread jiShuThread = new JiShuThread();
		jiShuThread.start();
		OuShuThread ouShuThread = new OuShuThread();
		ouShuThread.start();
	}
	
	
	
}
